﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FunArts.EasyDevOps.Shared.Models.SshClient.KeepAlivedClient
{
    public class VrrpInstance
    {
        /// <summary>
        /// 实例名称(如VI_1)
        /// </summary>
        public string Name { get; set; } = "VI_1";

        /// <summary>
        /// 初始状态(MASTER/BACKUP)
        /// </summary>
        public string State { get; set; } = "MASTER";

        /// <summary>
        /// 绑定的网络接口(如eth0)
        /// </summary>
        public string Interface { get; set; } = "eth0";

        /// <summary>
        /// 虚拟路由器ID(0-255,集群内必须一致)
        /// </summary>
        public int VirtualRouterId { get; set; } = 51;

        /// <summary>
        /// 优先级(1-254,值越大优先级越高)
        /// </summary>
        public int Priority { get; set; } = 100;

        /// <summary>
        /// 通告间隔(秒)
        /// </summary>
        public int AdvertInt { get; set; } = 1;

        /// <summary>
        /// 认证配置
        /// </summary>
        public VrrpAuthentication Authentication { get; set; } = new VrrpAuthentication();

        /// <summary>
        /// 虚拟IP地址列表(CIDR格式)
        /// </summary>
        public List<VirtualIpAddress> VirtualIpAddresses { get; set; } = new List<VirtualIpAddress>();

        /// <summary>
        /// 跟踪脚本列表
        /// </summary>
        public List<VrrpTrackScript> TrackScripts { get; set; } = new List<VrrpTrackScript>();

        /// <summary>
        /// 是否启用不抢占模式
        /// </summary>
        public bool Nopreempt { get; set; } = false;

        /// <summary>
        /// 抢占延迟时间(秒)
        /// </summary>
        public int PreemptDelay { get; set; } = 0;

        /// <summary>
        /// 状态切换通知脚本
        /// </summary>
        public NotificationScripts NotificationScripts { get; set; } = new NotificationScripts();
    }
}
